﻿<UserControl x:Class="CinchCodeGen.SinglePropertyView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="Auto" Width="Auto" Margin="4" HorizontalAlignment="Stretch">
    
    <Border Background="#FFEF6803" CornerRadius="5">
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>


            <!-- Column 1 -->
            <Label FontFamily="Arial" FontSize="13" Grid.Row="0" Grid.Column="0"
               Content="Property Name" Margin="5,0,0,0"
               VerticalAlignment="Center" Foreground="Black"
               FontWeight="Bold"
               HorizontalAlignment="Left"/>

            <TextBox Grid.Row="1" Grid.Column="0" Margin="5,0,0,0"
                Text="{Binding Path=PropName, Mode=TwoWay,
                UpdateSourceTrigger=LostFocus, 
                ValidatesOnDataErrors=True,
                ValidatesOnExceptions=True}"/>

            <CheckBox Grid.Row="2" Grid.Column="0" Margin="5,5,0,5" 
                  FontSize="13" Foreground="White"
                  FontWeight="Bold"
                  Content="Use DataWrapper&lt;T&gt;"
                  IsChecked="{Binding Path=UseDataWrapper, Mode=TwoWay,
                    UpdateSourceTrigger=LostFocus,
                    ValidatesOnDataErrors=True,
                    ValidatesOnExceptions=True}"/>


            <!-- Column 2 -->
            <Label FontFamily="Arial" FontSize="13" Grid.Row="0" Grid.Column="1"
               Content="Pick The Property Type" Margin="5,0,0,0"
               VerticalAlignment="Center" Foreground="Black"
               FontWeight="Bold"
               HorizontalAlignment="Left"/>

            <ComboBox Grid.Row="1" Grid.Column="1" Margin="5,0,0,0"
                  SelectedItem="{Binding Path=PropertyType, Mode=TwoWay,
                    UpdateSourceTrigger=LostFocus, 
                    ValidatesOnDataErrors=True,
                    ValidatesOnExceptions=True}">
                <ComboBox.ItemsSource>
                    <Binding Path="PropertyTypes"
                            Source="{x:Static Application.Current}"/>
                </ComboBox.ItemsSource>
            </ComboBox>

            <!-- Column 3-->
            <Button Grid.Column="2" Margin="0"
               Grid.RowSpan="3" Tag="../Images/error.ico"  
               Style="{StaticResource imageButtons}" 
               ToolTip="Delete this property" Width="30" Height="30" 
               Command="{Binding RemovePropertyCommand}"
               HorizontalAlignment="Center" 
               VerticalAlignment="Center"/>

        </Grid>
    </Border>
            
</UserControl>
